package com.jcwx.game.login;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.jcwx.game.domain.RegisterInfo;
import com.jcwx.game.util.BocHttpClient;

/**
 * 注册
 * @author csp
 *
 */
public class Register {
	
	
	private String url = "http://192.168.1.250:8880/api01/user/auto-register.action";
	
	public RegisterInfo getRegisterInfo(){
		Map<String, String> params = new HashMap<String, String>();
		String jsonObject="";
		try {
			jsonObject = BocHttpClient.sendPost(url, params);
			System.out.println(jsonObject);
		} catch (Exception e) {
			e.printStackTrace();
		}
		JSONObject json = JSONObject.parseObject(jsonObject);
		RegisterInfo registerInfo=new RegisterInfo();
		registerInfo.setCode(json.getInteger("code"));
		registerInfo.setMsg(json.getString("msg"));
		registerInfo.setPwsource(json.getString("pwsource"));
		registerInfo.setUid(json.getInteger("uid"));
		
		return registerInfo;
	}
	
	

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Register register=new Register();
		RegisterInfo registerInfo= register.getRegisterInfo();
		
		System.out.println(registerInfo.getMsg() +""+registerInfo.getPwsource()+""+registerInfo.getCode()+registerInfo.getUid());
		
	}
	
	
	
	
	

}
